import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel';

export interface ArticleInfo {
  id: number;
  title: string;
  cover: string;
  tag_ids: number[];
  tags: {
    id: number;
    name: string;
  }[];
  summary: string;
  content: string;
  views: number;
  status: number;
  created_at: string;
  updated_at: string;
}

export type ArticleListParams = BasicPageParams & {
  title?: string;
  tag_ids?: number[];
  status?: number;
};

export type ArticleListResultModel = BasicFetchResult<ArticleInfo>;

export interface ArticleListItem {
  id: number;
  title: string;
  keywords: string;
  cover: string;
  status: number;
  created_at: string;
  updated_at: string;
}

export interface ArticleAddReq {
  title: string;
  keywords?: string;
  cover?: string;
  tag_ids?: number[];
  desc?: string;
  content: string;
  status: number;
}

export interface ArticleEditReq extends ArticleAddReq {
  id: number;
}
